#pragma once

#define UNIT 	float
#define PUNIT	float * 
#define RESULT 	unsigned int

#define SUCCESS 0
#define FAIL -1

#define IS_FAIL(x) 	(if((x)!=0))
#define IS_GOOD(x) 	(if((x)==0))


// global includes
#define NOMINMAX
#include <irrlicht.h>
#include "Helpers.h"

using namespace irr;
using namespace core;
using namespace scene;
using namespace video;
using namespace io;
using namespace gui;


#include "IrrPhysx\IrrPhysx.h"

using namespace IrrPhysx;

// pragmas

#pragma comment(lib, "Irrlicht.lib")

#pragma comment(lib, "PhysXLoader.lib")
#pragma comment(lib, "NxCharacter.lib")
#pragma comment(lib, "NxCooking.lib")

#pragma comment(linker, "/subsystem:windows /ENTRY:mainCRTStartup")

#pragma warning (disable: 4482)

// enums
enum E_GAMEOBJECT_TYPE{
	BaseObject,
	SceneObject,
	Ship,
	Weapon,
	Projectile,
	Engine
};

enum E_COMPONENT_TYPE {
	Invalid
};

#define stricmp _stricmp
#define strdup _strdup

class CShip;
class CSceneObject;
class CGameManager;
class CHUDControl;
class CMemoryStream;

#include "Container.h"

#define SHIPVECTOR TContainer<CShip *>
#define OBJVECTOR TContainer<CSceneObject *>

#define OBJINTMAP std::map<s32, CSceneObject *>
#define OBJINTPAIR std::pair<s32,CSceneObject *>

#define OBJSTRMAP std::map<char *, CSceneObject *>
#define OBJSTRPAIR std::pair<char *,CSceneObject *>

struct SCrewCapacity {
	SCrewCapacity(){
		officers=enlisted=0;
	}
	SCrewCapacity(s32 _officers, s32 _enlisted) {
		officers = _officers;
		enlisted = _enlisted;
	}
	s32 officers;
	s32 enlisted;
};

struct SArmor {
	SArmor() {
		left=right=front=back=regen=0;
	}
	SArmor(f32 _regen, f32 value) {
		left = right = front = back = value;
		regen = _regen;
	}
	SArmor (f32 _regen, f32 sides, f32 ends) {
		left = right = sides; 
		front = back = ends;
		regen = _regen;
	}
	SArmor (f32 _regen, f32 _left, f32 _right, f32 _front, f32 _back) {
		left = _left;
		right = _right;
		front = _front;
		back = _back;
		regen = _regen;
	}

	f32 left;
	f32 right;
	f32 front;
	f32 back;
	f32 regen;
};

#include "Macros.h"